﻿using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Inspections;
using FluentNHibernate.Conventions.Instances;

namespace Genesis.Persistence.Mapping.Conventions
{

    public class HasManyConvention : IHasManyConvention
    {

        public void Apply(IOneToManyCollectionInstance instance)
        {

            instance.Key.Column(instance.EntityType.Name + "Id");
            instance.Cascade.All();
            instance.Access.ReadOnlyPropertyThroughCamelCaseField(CamelCasePrefix.None);

        }

    }

}